import Vue from 'vue'
// import { setLogin as login, getUserInfo as getInfo, setLogout as logout } from '@/api/user'

const user = {
  state: {
    token: '',
    name: '',
    roles: [],
    info: {}
  },

  mutations: {
    SET_TOKEN: (state, token) => {
      state.token = token
    },
    SET_NAME: (state, { name, welcome }) => {
      state.name = name
      state.welcome = welcome
    },
    SET_ROLES: (state, roles) => {
      state.roles = roles
    },
    SET_INFO: (state, info) => {
      state.info = info
    }
  },

  actions: {
    // 登录
    // Login ({ commit }, userInfo) {
    //   return new Promise((resolve, reject) => {
    //   })
    // },

    // 获取个人信息
    // GetInfo({commit}) {
    //   return new Promise((resolve, reject) => {
    //   })
    // },

    // 登出
    // Logout ({ commit, state }) {
    //   return new Promise((resolve) => {
    //   })
    // }
  }
}

export default user
